 

//全选 
  function checkAll(){
	    var type = document.forms[0].checkBoxType.value;
	    var status="selected";
		for (var i = 0; i < document.forms[0].elements.length; i++) {
			var e = document.forms[0].elements[i];
			if ((!e.disabled) && e.name == "checkboxs") {
				 e.checked = type;
			}
		}
		if(type=="selected") status="";
		document.forms[0].checkBoxType.value=status;
  }	   

//是否选中复选框值
 function isSelected() {
		for (var i = 0; i < document.all.length; i++) {
		if (document.all[i].tagName.toUpperCase() == "INPUT") {
			var tmp = document.all[i].type.toUpperCase();
			var name = document.all[i].name;
			if ((tmp == "CHECKBOX") && (document.all[i].checked == true) && (name == "checkboxs")) {
				return true;
			}
		}
	}
	return false;
 }

 
 
 function submitInfo() {
var property; //属性集合
	var message;  //消息集合
	if (propertys!= null && propertys!= ""&&msg!=null&&msg!="") {
		property = propertys.split(",");
		message = msg.split(",");
		for (i = 0; i < property.length; i++) {
			if(document.all[property[i]]!=null){ //是否存在
				var eleObj = document.all[property[i]];	 //对象
				var propertyValue=getPropertyValue(property[i]); //对象值
				var ms="\u662f\u5fc5\u987b\u8f93\u5165\u7684\u9879\u76ee";
				if(propertyValue=="" || propertyValue==null){
					alert(message[i] + ms);
					//转移焦点 
					if (document.all[property[i]].type == "text"||	//文本框
						document.all[property[i]].type == "textarea"|| //文本区
						document.all[property[i]].type == "select-one" //下拉框
						) {
						document.all[property[i]].focus();
					}
					return false;
				}
			}
		}
	}
}
 
 function elemGetAttribute(elem,attr) {
   try {
      return eval("elem."+attr);
   } catch (e) {
      return null;
   }
}
 
 //根据属性名得到其页面上的值
function getPropertyValue(propertyName){
	var propertyValue="";
	//如果是单选框
	if(document.all[propertyName].length!=null&&document.all[propertyName][0].type=="radio"){
		for(var i=0;i<document.all[propertyName].length;i++){
			if(document.all[propertyName][i].checked==true) 
				propertyValue = " ";
		}
	}
	//文本框、文本区或下拉框
	else{
		propertyValue=document.all(propertyName).value;
	}
	return propertyValue;
}

var checkEqpNoSameFlag=false;
function checkEqpNoSame(target,eqpId){
		    	 checkEqpNoSameFlag=false;
		    	 $.ajax({
					type:"POST",
					url:"eqpInfoAction_checkEqpCodeSame.do",
					data:"eqpNo="+target.value+"&eqpId="+eqpId+"&date="+new Date(),
					success:function(msg) {
						if(msg=="true"){
							alert("设备编号 '"+target.value+"' 已经存在!请重新输入!");
							checkEqpNoSameFlag=true;
							target.focus();
						}else{
							checkEqpNoSameFlag=false;
						}
					}
				});
  }


	function deleteFile(url){
	     document.forms[0].attributes["action"].value =url; 
	   	 document.forms[0].submit();
	}
